home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
netprog.zip
/
NETPROG.TAR
/
lib
/
hosterror.c
< prev
next >
Wrap
Text File
|
1989-12-17
|
551b
|
26 lines
/*
* Return a string containing some additional information after a
* host name or address lookup error - gethostbyname() or gethostbyaddr().
*/
int h_errno; /* host error number */
int h_nerr; /* # of error message strings */
char *h_errlist[]; /* the error message table */
char *
host_err_str()
{
static char msgstr[200];
if (h_errno != 0) {
if (h_errno > 0 && h_errno < h_nerr)
sprintf(msgstr, "(%s)", h_errlist[h_errno]);
else
sprintf(msgstr, "(h_errno = %d)", h_errno);
} else {
msgstr[0] = '\0';
}
return(msgstr);
}